<template>
  <div>
    <h2 align="center">管理员查看用户赎回明细</h2>
    <table class="table table-bordered">
      <tr>
        <td>投资项目编号</td>
        <td>账户名称</td>
        <td>投资总金额</td>
        <td>用户已投金额</td>
        <td>用户赎回金额</td>
      </tr>

      <tr v-for="item in list" v-if="list.length>0">
        <td>{{ item.I_Id }}</td>
        <td>{{ item.UL_Name }}</td>
        <td>{{ item.I_Budget }}</td>
        <td>{{ item.UI_Money }}</td>
        <td>{{ item.UIR_Money }}</td>
      </tr>

      <tr v-else>
        <td align="center" colspan="5">该项目没有信息</td>
      </tr>
    </table>
  </div>
</template>

<script setup lang="ts">

import {reactive,toRefs,onMounted} from 'vue'

import axios from 'axios';

import {useRouter,useRoute} from 'vue-router'

import {useUserStore} from '../../store/user'

let userStore = useUserStore()

let router = useRouter()
let route = useRoute()

//数据 
let data:any =reactive({
  list:[],
  showData:{
    I_Id:'',
    I_Name:'',
    I_Budget:'',
    pageindex:1,
    pagesize:3,
    MinMoney:'',
    MaxMoney:''
  },
  totalCount:0,
  totaPage:0,
  arr:[3,5,7],//改变页容量
  page:'' //跳转页
})

//解构
let {list,showData,totalCount,totaPage,arr,page} = toRefs(data)

//生命周期
//页面加载时
onMounted(()=>{
  //获取投资项目列表
  showlist()
})

//显示列表
const showlist= ()=>{
    axios({
      url:'/api/Invest/GetAllUserRedeemInfos',
      method:'get',
      params:{
        I_Id:route.query.I_Id
      }
    }).then(res=>{
      console.log(res);
      list.value=res.data.data
    }).catch(err=>{
      console.log(err);   
    })
}
</script>

<style scoped>

</style>